<template>
    <el-aside width="200px">
            <el-scrollbar>
                <!--default-openeds 默认打开  -->
                <el-menu :default-openeds="['1']" :router='true'>
                    <el-sub-menu index="1">
                        <template #title>
                            <el-icon>
                                <message />
                            </el-icon>Navigator One
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="/register">Option 1</el-menu-item>
                            <el-menu-item index="/register">Option 2</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <el-sub-menu index="2">
                        <template #title>
                            <el-icon>
                                <icon-menu />
                            </el-icon>Navigator Two
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="2-1">Option 1</el-menu-item>
                            <el-menu-item index="2-2">Option 2</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                </el-menu> 

            </el-scrollbar>

        </el-aside>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { Menu as IconMenu, Message, Setting } from '@element-plus/icons-vue'

import router from '../../router/index'
const menuList = ref([])
onMounted(() => {
    menuList.value = router.options.routes
    console.log(router.options.routes)
})
</script>